From 8f9701718f77ee8d242e79c1f57ddf6d9a76a6f2 Mon Sep 17 00:00:00 2001 From: "cl349@firebug.cl.cam.ac.uk" Date: Thu, 1 Sep 2005 10:26:17 +0000 Subject: [PATCH] Fix closing of /var/log/xend.log fd Fix the problem where /var/log/xend.log was getting closed and then /var/log/xend-debug was getting all the spam about the fd being closed in the logging stuff. Basically what was happening is that the main thread wasn't sticking around and during its exit, the atexit handlers of the python logging stuff got called closing the log fd. Patch makes it so that we instead wait on the real server threads to exit before shutting things down. Signed-off-by: Jeremy Katz Signed-off-by: Christian Limpach --- tools/python/xen/xend/server/SrvServer.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/python/xen/xend/server/SrvServer.py b/tools/python/xen/xend/server/SrvServer.py index 19106550b1..12a2f5ff5c 100644 --- a/tools/python/xen/xend/server/SrvServer.py +++ b/tools/python/xen/xend/server/SrvServer.py @@ -61,9 +61,14 @@ class XendServers: def start(self): Vifctl.network('start') + threads = [] for server in self.servers: thread = Thread(target=server.run) thread.start() + threads.append(thread) + + for t in threads: + t.join() def create(): root = SrvDir() -- 2.30.2